package com.naiterui.ehp.bs.doctor.fegin;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.bo.doctor.product.ProductInfoBO;
import com.naiterui.ehp.bp.bo.doctor.product.ProductSearchParamBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * b2cfeign调用
 *
 * @author yangfuya
 * @since 2022/3/29
 */
@FeignClient(name = "b2c", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface B2cFeignClient {
    /**
     * 医生常用药我的列表
     *
     * @param productSearch
     * @return
     */
    @PostMapping("inner/common/drug/list")
    PageVO<ProductInfoBO> list(@RequestBody ProductSearchParamBO productSearch);

    /**
     * 医生常用药使用列表
     *
     * @param productSearch
     * @return
     */
    @PostMapping("inner/common/drug/use/list")
    PageVO<ProductInfoBO> useList(@RequestBody ProductSearchParamBO productSearch);

    /**
     * 添加常用药
     * 
     * @param doctorId
     *            医生id
     * @param productId
     *            药品id
     * @throws BusinessException
     */
    @PostMapping("inner/common/drug/add/{doctorId}/{productId}")
    void addCommonDrug(@PathVariable("doctorId") Long doctorId, @PathVariable("productId") Long productId)
        throws BusinessException;

    /**
     * 移除常用药
     * 
     * @param doctorId
     *            医生id
     * @param productId
     *            药品id
     * @throws BusinessException
     */
    @PostMapping("inner/common/drug/remove/{doctorId}/{productId}")
    void removeCommonDrug(@PathVariable("doctorId") Long doctorId, @PathVariable("productId") Long productId)
        throws BusinessException;
}
